package initdb

import (
	"gitee.com/zaiqiang231/lovesport-user-service/app/store"
)

type DbTable struct {
}

func (i DbTable) GetTable() store.DbTable {
	return nil
}

func (i DbTable) InitializerName(table store.SubInitializer) string {
	return table.GetTable().TableName()
}

func (i DbTable) HasTable(ds *store.Datastore, table store.SubInitializer) bool {
	return ds.DB.Migrator().HasTable(table.GetTable())
}

func (i DbTable) CreateTable(ds *store.Datastore, table store.SubInitializer) error {
	return ds.DB.Migrator().AutoMigrate(table.GetTable())
}

func (i DbTable) InitData(ds *store.Datastore) {
}
